LDFLAGS=-Wl,--gc-sections -lpthread -ldl -lm
CFLAGS=-g -ffunction-sections -fdata-sections

all:
	cd ../ && ./build-release.sh -p x86
	gcc $(CFLAGS) test.c -o test ../../target/x86_64-unknown-linux-gnu/release/libiot_rs.a $(LDFLAGS)
tm:
	cd ../ && ./build-release.sh -p tm
	. tm.sh && arm-none-linux-gnueabihf-gcc $(CFLAGS) test.c -o test ../../target/armv7-unknown-linux-gnueabihf/release/libiot_rs.a $(LDFLAGS)
rk:
	cd ../ && ./build-release.sh -p rk
	. rk.sh && arm-rockchip830-linux-uclibcgnueabihf-gcc $(CFLAGS) test.c -o test ../../target/armv7-unknown-linux-uclibceabihf/release/libiot_rs.a $(LDFLAGS)
clean:
	rm test
